Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to electron 9-x-y #102011

Merged
merged 28 commits into from Jul 21, 2020
Merged

chore: update to electron 9-x-y #102011

merged 28 commits into from Jul 21, 2020

Conversation

deepak1556
Copy link
Contributor

@deepak1556 deepak1556 commented Jul 9, 2020

@deepak1556 deepak1556 requested a review from bpasero July 9, 2020 18:34
@deepak1556 deepak1556 self-assigned this Jul 9, 2020
@deepak1556 deepak1556 added this to the July 2020 milestone Jul 9, 2020
src/main.js Outdated Show resolved Hide resolved
build/azure-pipelines/product-build.yml Outdated Show resolved Hide resolved
src/bootstrap-fork.js Outdated Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
src/main.js Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
src/main.js Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
@bpasero
Copy link
Member

bpasero commented Jul 10, 2020

One thing I forgot: we need to offer the user a transition path if the user has configured the crash reporter to be disabled in settings. E.g. we could check this setting on startup and update the argv.json automatically + maybe inform the user that a restart is needed.

@bpasero bpasero self-requested a review July 10, 2020 11:46
@bpasero bpasero marked this pull request as draft July 10, 2020 11:46
@bpasero
Copy link
Member

bpasero commented Jul 10, 2020

Converting to draft, please ping when ready for final reivew.

@deepak1556
Copy link
Contributor Author

deepak1556 commented Jul 10, 2020

@bpasero I have addressed the feedback, only work left is to accept the crash reporter extra parameters in the appcenter backend. PR in general is ready for review.

@bpasero bpasero marked this pull request as ready for review July 10, 2020 11:53
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides my comments in code, what is the plan to transition users to argv.json that today have the crash reporter disabled in settings?

src/vs/workbench/electron-browser/window.ts Outdated Show resolved Hide resolved
src/bootstrap-fork.js Outdated Show resolved Hide resolved
src/vs/workbench/electron-browser/window.ts Outdated Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
@deepak1556
Copy link
Contributor Author

deepak1556 commented Jul 11, 2020

@bpasero I have refactored the crashreporter implementation yet again due to some regressions/complexities faced during testing.

  • First idea was to send the appcenter specific data uid, iid, sid as extra parameters with crashReporter.addExtraParameter. The downside of this api is that the crash report will contain these extra parameters only in the process in which this api is called, that means we have to make sure to call the api in main, all the different renderers and node child processes, which increases the complexity of the implementation.

  • Instead I have taken the initial approach to encode all these data in the crash reporter startup which by default will carry these data for all processes. Only thing is that I have eliminated the use of sessionId from telemetryInfo because we are not using it in appcenter before and trying to add that info in the main process will only increase the complexity without any added benefits. And instead of reading from the storage service which uses sqlitedb underneath I have added a simpe one time unique crashReporterId that will be stored under the user data dir.

  • On linux, for child node processes the crash reporter has to be started explicitly, for which we share the crashReporterId from the previous step via command line that again eliminates doing any filesystem operations.

  • For disabling the appcenter crash reporter there are now 3 ways

    • Using --crash-reporter-directory which will save the crash reports locally
    • Setting "disable-crash-reporter": true in Configure runtime arguments
    • Using --disable-crash-reporter from the command line

Have verified this to work for all 3 platforms and for all the processes we are interested in.

@deepak1556 deepak1556 marked this pull request as ready for review July 12, 2020 04:34
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think we are getting to a nicer solution slowly. More feedback provided.

src/main.js Outdated Show resolved Hide resolved
src/bootstrap-fork.js Outdated Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
src/main.js Show resolved Hide resolved
@deepak1556 deepak1556 marked this pull request as draft July 13, 2020 06:08
@deepak1556 deepak1556 marked this pull request as ready for review July 13, 2020 06:36
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found some quirks still, commented inline. Maybe it is easier we walk through the code together and you make some notes.

src/main.js Outdated Show resolved Hide resolved
src/vs/workbench/electron-browser/window.ts Outdated Show resolved Hide resolved
src/main.js Outdated Show resolved Hide resolved
src/main.js Show resolved Hide resolved
const argvString = argvContent.value.toString();
const argvJSON = JSON.parse(stripComments(argvString));
if (argvJSON['enable-crash-reporter'] === undefined) {
const enableCrashReporter = this.configurationService.getValue<boolean>('telemetry.enableCrashReporter');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this returns undefined in the main process. Is it too early to check the value ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@deepak1556 configuration service in electron-main has no defaults because they get registered in renderer only. @sandy081 might have an issue for that, but for now we have to fill in the default value manually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is the limitation of using configuration service in non renderer process (main, shared). There could be an issue exists already but not sure.

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only few comments left, getting close 👍

src/vs/workbench/electron-sandbox/desktop.contribution.ts Outdated Show resolved Hide resolved
src/vs/platform/environment/node/argv.ts Show resolved Hide resolved
src/main.js Show resolved Hide resolved
@deepak1556
Copy link
Contributor Author

@bpasero should be good to go, PTAL.

@bpasero bpasero self-requested a review July 15, 2020 04:29
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

@deepak1556
Copy link
Contributor Author

Internal builds with working devtools have been updated in vscode-electron-prebuilt, this PR is ready to be landed.

@bpasero
Copy link
Member

bpasero commented Jul 21, 2020

@deepak1556 let me do the app.focus change we talked about and then merge this in?

@deepak1556
Copy link
Contributor Author

sounds good, feel free to merge the PR at your convenience. I am gonna sign-off for the day :)

@@ -1,3 +1,3 @@
disturl "http://nodejs.org/dist"
target "12.4.0"
target "12.14.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexdima fyi not sure why remote locked the dependency to 12.4.0 but it would now advance to the same as Electron 9

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Maybe there was no node release with the same version number as the one used in Electron?

@bpasero bpasero merged commit 3d0d50c into master Jul 21, 2020
@bpasero bpasero deleted the robo/update_electron_9 branch July 21, 2020 07:39
joaomoreno pushed a commit that referenced this pull request Jul 21, 2020
* chore: bump electron@9.0.5

* remove exploration config

* fix compile error

* fix compile error

* crashReporter has to be called only once before app ready

* chore: bump electron@9.1.0

* enable LayoutNG

* fix cron schedule

* allow disabling appcenter crash reporting

* set additional crash reporting parameters

* start crashreporter for child process on linux

* setup crash parameters only once

* remove unused crashReporter.guid

* address review feedback

* reuse argv.json for storing crash reporter id

* remove trailing commas

* update localized name

* update argv based on telemetry optout

* update initial config based on setting

* fix conditional errors

* remove telemetry.enableCrashReporter

* move default crash reporter config to electron-main

* update comment for ext host crash reporting

* set default value for configuration

* some 💄 changes

* address review feedback

* do not use ES7 features in JS yet

* add app.focus({ steal: true }) usage

Co-authored-by: Benjamin Pasero <benjpas@microsoft.com>
deepak1556 added a commit that referenced this pull request Jul 30, 2020
deepak1556 added a commit that referenced this pull request Jul 30, 2020
deepak1556 added a commit that referenced this pull request Aug 5, 2020
* chore: bump electron@9.0.5

* remove exploration config

* fix compile error

* fix compile error

* crashReporter has to be called only once before app ready

* chore: bump electron@9.1.0

* enable LayoutNG

* fix cron schedule

* allow disabling appcenter crash reporting

* set additional crash reporting parameters

* start crashreporter for child process on linux

* setup crash parameters only once

* remove unused crashReporter.guid

* address review feedback

* reuse argv.json for storing crash reporter id

* remove trailing commas

* update localized name

* update argv based on telemetry optout

* update initial config based on setting

* fix conditional errors

* remove telemetry.enableCrashReporter

* move default crash reporter config to electron-main

* update comment for ext host crash reporting

* set default value for configuration

* some 💄 changes

* address review feedback

* do not use ES7 features in JS yet

* add app.focus({ steal: true }) usage

Co-authored-by: Benjamin Pasero <benjpas@microsoft.com>
deepak1556 added a commit that referenced this pull request Aug 11, 2020
Co-authored-by: Benjamin Pasero <benjpas@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Sep 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants